﻿<TabItem x:Class="AuftragControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"
             xmlns:metro="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
             xmlns:my="clr-namespace:Biller"
             mc:Ignorable="d"
             d:DesignHeight="476" d:DesignWidth="1300" MinHeight="800" Margin="5,5,0,0" Visibility="Collapsed" >
    <TabItem.Resources>
        <ResourceDictionary>
            <my:OrderTypeConverter x:Key="OrderTypeConverter"/>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary x:Name="LocalizationStrings" Source="OrderControl_de-de.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </TabItem.Resources>
    <TabControl Style="{DynamicResource InnerBackstageTabControlStyle}" Name="TabAuftrag" SelectedIndex="1">
        <Fluent:SeparatorTabItem Header="{DynamicResource OrderOverview}" MinWidth="200" Margin="0,6,0,0" />
        <TabItem Name="AuftragEmpfänger" IsSelected="true" Margin="0,10,0,0" MaxWidth="300" MinHeight="72" Height="{Binding ElementName=_grid_receiver, Path=ActualHeight}">
            <TabItem.Header>
                <Grid>
                    <StackPanel Width="48" Margin="10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
                            <Image Source="..\..\Images\customer.png"  Width="48" Height="48" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0"/>
                    </StackPanel>
                    <Grid Margin="68,0,0,0" Name="_grid_receiver">
                        <StackPanel Orientation="Vertical" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="False">
                            <TextBlock Text="{DynamicResource ReceiverHeader}"/>
                            <TextBlock Text="{DynamicResource ReceiverDescr}" Foreground="DimGray" TextWrapping="Wrap" />
                        </StackPanel>
                    </Grid>
                </Grid>
            </TabItem.Header>
            <ScrollViewer VerticalScrollBarVisibility="Auto">
                <StackPanel>
                    <Fluent:SeparatorTabItem Margin="6,6,0,0" Header="{DynamicResource InvoiceAddress}" Height="28" VerticalAlignment="Top" />
                    <StackPanel Margin="20,20,20,0">
                        <Grid Height="72">
                            <Grid Width="150" HorizontalAlignment="Left">
                                <Image Source="..\..\Images\customer.png" Width="48" Height="48" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0"/>
                            </Grid>
                            <Grid Margin="160,0,0,0" Name="_grid_contentpresenter">
                                <StackPanel VerticalAlignment="Center">
                                    <TextBlock Text="{DynamicResource NoCustomerSelected}" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,0,0,5" Name="Txt_Receiver_header"/>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{Binding Customer.Address}" Margin="7,0,0,0" TextWrapping="Wrap" MaxWidth="{Binding ElementName=_grid_contentpresenter, Path=ActualWidth}" Name="Txt_Receiver_address"/>
                                    </StackPanel>
                                </StackPanel>
                            </Grid>
                        </Grid>
                        <Grid Height="120" Margin="0,20,0,0">
                            <Grid Width="150" HorizontalAlignment="Left">
                                <Fluent:Button Name="buttonAuftragKundewählen" Style="{DynamicResource ButtonBackstageStyle}" Header="{DynamicResource CustomerDatabaseButton}" Icon="../../Images/kundehinzufuegen.png" LargeIcon="../../Images\kundehinzufuegen.png"  Width="100" Height="85" d:IsHidden="True"/>
                            </Grid>
                            <Grid Margin="160,0,0,0">
                                <StackPanel VerticalAlignment="Center">
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{DynamicResource CustomerDatabaseInfo}" Margin="7,0,0,0" TextWrapping="Wrap" MaxWidth="{Binding ElementName=_grid_contentpresenter, Path=ActualWidth}"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,7,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{DynamicResource CustomerFastPickInfo}" Margin="7,2,0,0" TextWrapping="Wrap" />
                                        <TextBox Width="100" Name="TB_CustomerFastPick" Margin="5,0,0,0" />
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="False" Name="SP_FastPickInfo" Visibility="Collapsed">
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{DynamicResource CustomerNotExisting}" Margin="7,0,0,0" TextWrapping="Wrap" MaxWidth="{Binding ElementName=_grid_contentpresenter, Path=ActualWidth}" Name="TB_FastPickInfo"/>
                                    </StackPanel>
                                </StackPanel>
                            </Grid>
                        </Grid>
                        <Grid Height="100" Margin="0,20,0,0" Visibility="Collapsed">
                            <Grid Width="150" HorizontalAlignment="Left">
                                <Fluent:ToggleButton Style="{DynamicResource ToggleButtonBackstageStyle}" Name="buttonAuftragKundeEigen" Header="{DynamicResource OwnCustomerButton}" Icon="../../Images\kundeedit.png" LargeIcon="../../Images\kundeedit.png" Width="100" Height="85" d:IsHidden="True"/>
                            </Grid>
                            <Grid Margin="160,0,0,0">
                                <StackPanel VerticalAlignment="Center">
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{DynamicResource OwnCustomerInfo1}" Margin="7,0,0,0" TextWrapping="Wrap" MaxWidth="{Binding ElementName=_grid_contentpresenter, Path=ActualWidth}"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{DynamicResource OwnCustomerInfo2}" Margin="7,0,0,0" TextWrapping="Wrap" MaxWidth="{Binding ElementName=_grid_contentpresenter, Path=ActualWidth}"/>
                                    </StackPanel>
                                </StackPanel>
                            </Grid>
                        </Grid>
                        <Grid Height="170" Name="GroupAuftragEigeneAdresse" VerticalAlignment="Top" Visibility="Collapsed" Margin="0,10,0,0">
                            <Grid Width="150" HorizontalAlignment="Left">
                                <Image Source="..\..\Images\kundeedit.png" Width="48" Height="48" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0"/>
                            </Grid>
                            <Grid Margin="160,0,0,0">
                                <StackPanel VerticalAlignment="Center">
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="True" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,7,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{DynamicResource Salutation}" Margin="7,2,0,0" TextWrapping="Wrap" Width="120"/>
                                        <TextBox Height="23" Name="TextBoxSalutation" Width="120" VerticalAlignment="Top" HorizontalAlignment="Left" TabIndex="1"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="True" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,7,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{DynamicResource FornameSurname}" Margin="7,2,0,0" TextWrapping="Wrap" Width="120"/>
                                        <TextBox Height="23" Name="TextBox1" Width="120" VerticalAlignment="Top" HorizontalAlignment="Left" TabIndex="2"/>
                                        <TextBox Height="23" Name="TextBox2" Width="120" VerticalAlignment="Top" HorizontalAlignment="Left" TabIndex="3" Margin="5,0,0,0" />
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="True" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,7,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{DynamicResource StreetNo}" Margin="7,2,0,0" TextWrapping="Wrap" Width="120"/>
                                        <TextBox Height="23" Name="TextBox3" HorizontalAlignment="Left" Width="177" VerticalAlignment="Top" TabIndex="4"/>
                                        <TextBox Margin="5,0,0,0" Name="TextBox4" Height="23" VerticalAlignment="Top" HorizontalAlignment="Left" Width="63" TabIndex="5"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="True" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,7,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{DynamicResource ZipCity}" Margin="7,2,0,0" TextWrapping="Wrap" Width="120"/>
                                        <TextBox Height="23" Name="TextBox21" VerticalAlignment="Top" TabIndex="6" HorizontalAlignment="Left" Width="91"/>
                                        <TextBox Margin="5,0,0,0" Width="149" Name="TextBox6" Height="23" VerticalAlignment="Top" TabIndex="7"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="True" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,7,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{DynamicResource Country}" Margin="7,2,0,0" TextWrapping="Wrap" Width="120"/>
                                        <TextBox Height="23" Name="TextBox5" VerticalAlignment="Top" Width="245" TabIndex="8" />
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="True" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,7,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{DynamicResource AddressAddition}" Margin="7,2,0,0" TextWrapping="Wrap" Width="120"/>
                                        <TextBox Height="23" Name="TextBox7" VerticalAlignment="Top" Width="245" TabIndex="8" />
                                    </StackPanel>
                                </StackPanel>
                            </Grid>
                        </Grid>
                    </StackPanel>
                    <Fluent:SeparatorTabItem Margin="6,20,0,0" Header="{DynamicResource DeliveryAddress}" Height="28" VerticalAlignment="Top" />
                    <StackPanel Margin="20,20,20,0">
                        <Grid Height="100" Margin="0,0,0,0">
                            <Grid Width="150" HorizontalAlignment="Left">
                                <Fluent:ToggleButton Style="{DynamicResource ToggleButtonBackstageStyle}" Name="buttonAuftragLieferanschrift" IsChecked="True" Header="{DynamicResource DeliveryAddressButton}" Icon="../../Images\package.png" LargeIcon="../../Images\package.png" Width="100" Height="85" d:IsHidden="True"/>
                            </Grid>
                            <Grid Margin="160,0,0,0">
                                <StackPanel VerticalAlignment="Center">
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{DynamicResource DeliveryAddressInfo}" Margin="7,0,0,0" TextWrapping="Wrap" MaxWidth="{Binding ElementName=_grid_contentpresenter, Path=ActualWidth}"/>
                                    </StackPanel>
                                </StackPanel>
                            </Grid>
                        </Grid>
                        <Grid  Name="Grid_OrderDeliverAddress" VerticalAlignment="Top" Visibility="Collapsed" Margin="0,10,0,0">
                            <Grid Width="150" HorizontalAlignment="Left">
                                <Image Source="..\..\Images\package-edit.png" Width="48" Height="48" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0"/>
                            </Grid>
                            <Grid Margin="160,0,0,0">
                                <StackPanel VerticalAlignment="Center">
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="True" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,7,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="Aus Vorlage wählen:" Margin="7,2,0,0" TextWrapping="Wrap" Width="120"/>
                                        <ComboBox Width="120" Height="23" DisplayMemberPath="AddressDescription" ItemsSource="{Binding Addresses}" Name="CBCustomerAddresses"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="True" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,7,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{DynamicResource Salutation}" Margin="7,2,0,0" TextWrapping="Wrap" Width="120"/>
                                        <TextBox Height="23" HorizontalAlignment="Left" Name="Deliver_tb" VerticalAlignment="Top" Width="120" TabIndex="1" Text="{Binding DeliverySalutation}"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="True" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,7,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{DynamicResource FornameSurname}" Margin="7,2,0,0" TextWrapping="Wrap" Width="120"/>
                                        <TextBox Height="23" Name="Deliver_tb_fn" Width="120" VerticalAlignment="Top" HorizontalAlignment="Left" TabIndex="2" Text="{Binding DeliveryForname}"/>
                                        <TextBox Height="23" Name="Deliver_tb_ln" Width="120" VerticalAlignment="Top" HorizontalAlignment="Left" TabIndex="3" Margin="5,0,0,0" Text="{Binding DeliverySurname}"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="True" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,7,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{DynamicResource StreetNo}" Margin="7,2,0,0" TextWrapping="Wrap" Width="120"/>
                                        <TextBox Height="23" Name="Deliver_tb_st" HorizontalAlignment="Left" Width="177" VerticalAlignment="Top" TabIndex="4" Text="{Binding DeliveryStreet}"/>
                                        <TextBox Margin="5,0,0,0" Name="Deliver_tb_hn" Height="23" VerticalAlignment="Top" HorizontalAlignment="Left" Width="63" TabIndex="5" Text="{Binding DeliveryNo}"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="True" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,7,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{DynamicResource ZipCity}" Margin="7,2,0,0" TextWrapping="Wrap" Width="120"/>
                                        <TextBox Height="23" Name="Deliver_tb_zip" VerticalAlignment="Top" TabIndex="6" HorizontalAlignment="Left" Width="91" Text="{Binding DeliveryZip}"/>
                                        <TextBox Margin="5,0,0,0" Width="149" Name="Deliver_tb_ci" Height="23" VerticalAlignment="Top" TabIndex="7" Text="{Binding DeliveryCity}"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="True" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,7,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{DynamicResource Country}" Margin="7,2,0,0" TextWrapping="Wrap" Width="120"/>
                                        <TextBox Height="23" Name="Deliver_tb_co" VerticalAlignment="Top" Width="245" TabIndex="8" Text="{Binding DeliveryCountry}"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="True" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,7,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                        <TextBlock Text="{DynamicResource AddressAddition}" Margin="7,2,0,0" TextWrapping="Wrap" Width="120"/>
                                        <TextBox Height="23" Name="Deliver_tb_ad" VerticalAlignment="Top" Width="245" TabIndex="8" Text="{Binding DeliveryAddition}"/>
                                    </StackPanel>
                                </StackPanel>
                            </Grid>
                        </Grid>
                    </StackPanel>
                </StackPanel>
            </ScrollViewer>
        </TabItem>
        <TabItem Name="AuftragArtikel" MaxWidth="300" MinHeight="72" Height="{Binding ElementName=__grid_basket, Path=ActualHeight}">
            <TabItem.Header>
                <Grid>
                    <StackPanel Width="48" Margin="10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
                        <Image Source="..\..\Images\basket.png"  Width="48" Height="48" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0"/>
                    </StackPanel>
                    <Grid Margin="68,0,0,0" Name="_grid_basket">
                        <StackPanel Orientation="Vertical" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="False">
                            <TextBlock Text="{DynamicResource ItemArticleOverviewHeader}"/>
                            <TextBlock Text="{DynamicResource ItemArticleOverviewInfo}" Foreground="DimGray" TextWrapping="Wrap" />
                        </StackPanel>
                    </Grid>
                </Grid>
            </TabItem.Header>
            <Grid Name="AuftragsübersichtGrid">
                <Grid.RowDefinitions>
                    <RowDefinition Height="5*" />
                    <RowDefinition Height="1.1*" MinHeight="100" MaxHeight="100"/>
                </Grid.RowDefinitions>
                <ListView Margin="6,6,6,28" Name="ListViewAuftragsArtikel" SelectionMode="Single" UseLayoutRounding="True" ItemsSource="{Binding OrderedArticles}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" >
                    <ListView.ItemContainerStyle>
                        <Style TargetType="ListViewItem">
                            <Setter Property="MinHeight" Value="50px" />
                            <Setter Property="HorizontalContentAlignment" Value="Center" />
                        </Style>
                    </ListView.ItemContainerStyle>
                    <ListView.View>
                        <GridView x:Name="GridViewAuftrag">
                            <GridViewColumn Header="{DynamicResource ArticleListArtNo}" Width="{Binding ElementName=helperWidthAuftragsArtikel1, Path=ActualWidth}" DisplayMemberBinding="{Binding ArticleID}" x:Name="CHAufArtNr" />
                            <GridViewColumn Header="{DynamicResource ArticleListArtDescr}" Width="{Binding ElementName=helperWidthAuftragsArtikel2, Path=ActualWidth}" DisplayMemberBinding="{Binding ArticleDescription}" x:Name="CHAufArtNa"/>
                            <GridViewColumn Header="{DynamicResource ArticleListSinglePrice}" Width="{Binding ElementName=helperWidthAuftragsArtikel3, Path=ActualWidth}" DisplayMemberBinding="{Binding OrderPrice}" x:Name="CHAufArtPr"/>
                            <GridViewColumn Header="{DynamicResource ArticleListAmount}" Width="{Binding ElementName=helperWidthAuftragsArtikel4, Path=ActualWidth}" DisplayMemberBinding="{Binding AmountString}" x:Name="CHAufArtMe"/>
                            <GridViewColumn Header="{DynamicResource ArticleListRevenue}" Width="{Binding ElementName=helperWidthAuftragsArtikel5, Path=ActualWidth}" DisplayMemberBinding="{Binding DiscountString}" x:Name="CHAufArtRa"/>
                            <GridViewColumn Header="{DynamicResource ArticleListArtInfotext}" Width="{Binding ElementName=helperWidthAuftragsArtikel6, Path=ActualWidth}" DisplayMemberBinding="{Binding OrderText}" x:Name="CHAufArtIt"/>
                            <GridViewColumn Header="{DynamicResource ArticleListSalePrice}" Width="{Binding ElementName=helperWidthAuftragsArtikel7, Path=ActualWidth}" DisplayMemberBinding="{Binding GrossOrderValue}" x:Name="CHAufArtVerPr"/>
                        </GridView>
                    </ListView.View>
                </ListView>
                <Grid Visibility="Hidden" Width="{Binding ElementName=ListViewAuftragsArtikel, Path=ActualWidth}" Margin="6,10,6,31" Grid.RowSpan="1">
                    <Grid.ColumnDefinitions>
                        <!--Width is bound to width of the first GridViewColumn -->
                        <ColumnDefinition Width="0.5*" MaxWidth="120"/>
                        <ColumnDefinition Width="0.8*" MaxWidth="200"/>
                        <ColumnDefinition Width="0.5*" MaxWidth="120"/>
                        <ColumnDefinition Width="0.5*" MaxWidth="120"/>
                        <ColumnDefinition Width="0.5*" MaxWidth="100"/>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="0.5*" MaxWidth="120"/>
                        <ColumnDefinition Width="0.2*" MaxWidth="20"/>
                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="0" x:Name="helperWidthAuftragsArtikel1" />
                    <Grid Grid.Column="1" x:Name="helperWidthAuftragsArtikel2" />
                    <Grid Grid.Column="2" x:Name="helperWidthAuftragsArtikel3"/>
                    <Grid Grid.Column="3" x:Name="helperWidthAuftragsArtikel4" />
                    <Grid Grid.Column="4" x:Name="helperWidthAuftragsArtikel5" />
                    <Grid Grid.Column="5" x:Name="helperWidthAuftragsArtikel6" />
                    <Grid Grid.Column="6" x:Name="helperWidthAuftragsArtikel7"/>
                </Grid>
                <StackPanel Height="26" VerticalAlignment="Bottom" Orientation="Horizontal" HorizontalAlignment="Right">
                    <Label Content="Gesamtpreis (Nettorechnung):" Height="26" HorizontalAlignment="Right"/>
                    <Label Content="{Binding GoodValueFromNet}" Height="26" HorizontalAlignment="Right" Margin="0,0,26,0" VerticalAlignment="Bottom" Width="70"/>
                    <Label Content="Gesamtpreis:" Height="26" HorizontalAlignment="Right"/>
                    <Label Content="{Binding GoodValue}" Height="26" HorizontalAlignment="Right" Margin="0,0,6,0" VerticalAlignment="Bottom" Width="70"/>
                </StackPanel>

                <Border Height="2" Width="Auto" BorderBrush="White" Margin="5,0,5,99" Background="#FF9199A4" BorderThickness="0,0,0,1" Grid.RowSpan="2" VerticalAlignment="Bottom" />
                <Grid Grid.Row="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" MinWidth="200" MaxWidth="300"/>
                        <ColumnDefinition Width="1.5*" MinWidth="200" MaxWidth="300"/>
                        <ColumnDefinition Width="2*"/>
                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="0">
                        <Label Content="{DynamicResource ArtDetailArticle}" Height="28" HorizontalAlignment="Left" Margin="10,10,0,0" Name="Label23" VerticalAlignment="Top" />
                        <Label Content="{DynamicResource ArtDetailArtNo}" Height="28" HorizontalAlignment="Left" Margin="10,40,0,0" Name="Label24" VerticalAlignment="Top" />
                        <Label Height="28" Margin="101,10,6,0" Name="lbl_auf_art" VerticalAlignment="Top" Content="{Binding ElementName=ListViewAuftragsArtikel, Path=SelectedItem.ArticleDescription}"/>
                        <Label Height="28" Margin="101,40,6,0" Name="lbl_auf_artnr" VerticalAlignment="Top" Content="{Binding ElementName=ListViewAuftragsArtikel, Path=SelectedItem.ArticleID}"/>
                        <TextBox BorderBrush="#FF9A9C9E" Margin="15,70,7,0" metro:TextboxHelper.Watermark="Schnelles hinzufügen per Artikelnummer" VerticalAlignment="Top" Height="26" Name="TextBox11">
                            <TextBox.ToolTip>
                                <Fluent:ScreenTip Name="articlequickaddtt" HelpLabelVisibility="Collapsed" Width="450" Image="..\..\Images\artikeladd.png" IsRibbonAligned="False"/>
                            </TextBox.ToolTip>
                        </TextBox>
                        <Grid.Resources>
                            <ResourceDictionary>
                                <ResourceDictionary.MergedDictionaries>
                                    <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
                                    <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
                                    <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
                                </ResourceDictionary.MergedDictionaries>
                            </ResourceDictionary>
                        </Grid.Resources>
                    </Grid>
                    <Grid Grid.Column="1">
                        <Label Content="{DynamicResource ArtDetailSalesAmount}" Height="28" HorizontalAlignment="Left" Margin="6,10,0,0" Name="Label26" VerticalAlignment="Top" />
                        <Label Content="{DynamicResource ArtDetailSalesPrice}" Height="28" HorizontalAlignment="Left" Margin="6,40,0,0" Name="Label27" VerticalAlignment="Top" />
                        <Label Content="{DynamicResource ArtDetailSalesRevenue}" Height="28" HorizontalAlignment="Left" Margin="6,71,0,0" Name="Label29" VerticalAlignment="Top" />
                        <TextBox BorderBrush="#FF9A9C9E" Height="23" Margin="99,12,7,0" Name="TextBox8" VerticalAlignment="Top" Text="{Binding ElementName=ListViewAuftragsArtikel, Path=SelectedItem.AmountString, Mode=OneWay}"/>
                        <TextBox BorderBrush="#FF9A9C9E" Height="23" Margin="99,42,7,0" Name="TextBox9" VerticalAlignment="Top" Text="{Binding ElementName=ListViewAuftragsArtikel, Path=SelectedItem.OrderPrice, Mode=OneWay}"/>
                        <TextBox BorderBrush="#FF9A9C9E" Height="23" Margin="99,73,7,0" Name="TextBox10" VerticalAlignment="Top" Text="{Binding ElementName=ListViewAuftragsArtikel, Path=SelectedItem.DiscountString, Mode=OneWay}"/>
                    </Grid>
                    <Grid Grid.Column="2">
                        <TextBox AcceptsReturn="True" BorderBrush="#FF9A9C9E" Height="56" HorizontalScrollBarVisibility="Auto" Margin="57,10,6,0" Name="TextBox22" TextWrapping="NoWrap" VerticalAlignment="Top" VerticalScrollBarVisibility="Auto" Text="{Binding ElementName=ListViewAuftragsArtikel, Path=SelectedItem.OrderText}"/>
                        <Label Content="{DynamicResource ArtDetailInfotext}" Height="28" HorizontalAlignment="Left" Margin="6,10,0,0" Name="Label28" VerticalAlignment="Top" />
                        <Fluent:Spinner BorderBrush="#FF9A9C9E" Format="0" Height="28" HorizontalAlignment="Left" IsTabStop="False" Margin="136,69,0,0" Maximum="0" Name="SpinnerArtikelPosition" VerticalAlignment="Top" Width="95" Value="{Binding ElementName=ListViewAuftragsArtikel, Path=SelectedItem.OrderPosition}"/>
                        <Label Content="{DynamicResource ArtDetailArticlePosition}" Height="28" HorizontalAlignment="Left" Margin="57,70,0,0" Name="Label25" VerticalAlignment="Top" />
                    </Grid>
                </Grid>
            </Grid>
        </TabItem>
        <TabItem Name="AuftragZahlung" MaxWidth="300" MinHeight="72" Height="{Binding ElementName=___grid_others, Path=ActualHeight}">
            <TabItem.Header>
                <Grid>
                    <StackPanel Width="48" Margin="10,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
                        <Image Source="..\..\Images\money.png" Width="48" Height="48" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0"/>
                    </StackPanel>
                    <Grid Margin="68,0,0,0" Name="_grid_others">
                        <StackPanel Orientation="Vertical" VerticalAlignment="Center" Margin="0,0,0,5" ClipToBounds="False">
                            <TextBlock Text="{DynamicResource ItemOthersHeader}"/>
                            <TextBlock Text="{DynamicResource ItemOthersInfo}" Foreground="DimGray" TextWrapping="Wrap" />
                        </StackPanel>
                    </Grid>
                </Grid>
            </TabItem.Header>
            <ScrollViewer VerticalScrollBarVisibility="Auto">
                <Grid>
                    <StackPanel>
                        <Grid Margin="20,20,20,0">
                            <Grid Width="100" HorizontalAlignment="Left">
                                <Image Height="64" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0"/>
                            </Grid>
                            <Grid Margin="110,0,0,0">
                                <StackPanel VerticalAlignment="Center">
                                    <Fluent:SeparatorTabItem Header="{StaticResource Discounts}" Margin="6,0,0,0" VerticalAlignment="Top" FontSize="14" FontWeight="Bold" Foreground="DimGray"/>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,5,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                        <TextBlock Width="130" Text="{StaticResource FixedDiscountValue}" Margin="7,0,0,0" TextWrapping="Wrap" VerticalAlignment="Center"/>
                                        <TextBox Height="23" Margin="7,0,0,0" Name="TextBox40" Text="{Binding Reduction, Mode=OneWay}" HorizontalAlignment="Right" Width="200" BorderBrush="#FF9A9C9E"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="20,0,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                        <TextBlock Width="110" Text="{StaticResource FixedDiscountValueDescr}" Margin="7,0,0,0" TextWrapping="Wrap" VerticalAlignment="Center"/>
                                        <TextBox Height="23" Margin="7,0,0,0" Name="TextBox41" Text="{Binding ReductionText}" HorizontalAlignment="Right" Width="200" BorderBrush="#FF9A9C9E"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,5,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                        <TextBlock Width="130" Text="{StaticResource TotalRevenue}" Margin="7,0,0,0" TextWrapping="Wrap" VerticalAlignment="Center"/>
                                        <TextBox Height="23" Margin="7,0,0,0" Name="TextBox36" HorizontalAlignment="Right" Width="200" BorderBrush="#FF9A9C9E" Text="0,00 %"/>
                                    </StackPanel>
                                </StackPanel>
                            </Grid>
                        </Grid>
                        <Grid Margin="20,20,20,0">
                            <Grid Width="100" HorizontalAlignment="Left">
                                <Image Height="64" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0"/>
                            </Grid>
                            <Grid Margin="110,0,0,0">
                                <StackPanel VerticalAlignment="Center">
                                    <Fluent:SeparatorTabItem Header="{StaticResource PaymentMethode}" Margin="6,0,0,0" FontSize="14" FontWeight="Bold" Foreground="DimGray" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,5,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                        <ComboBox Height="23" HorizontalAlignment="Left" Margin="7,0,0,0" Name="ComboBox10" VerticalAlignment="Top" Width="239" DisplayMemberPath="Name" SelectedItem="{Binding PaymentMethode}"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="20,0,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                        <TextBlock Text="{StaticResource DiscountAmount}" Margin="7,0,0,0" TextWrapping="Wrap" VerticalAlignment="Center"/>
                                        <TextBlock Text="{Binding SkontoValue}" Margin="7,0,0,0" TextWrapping="Wrap" VerticalAlignment="Center"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="20,0,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                        <TextBlock Text="{StaticResource TotalOrderValue}" Margin="7,0,0,0" TextWrapping="Wrap" VerticalAlignment="Center"/>
                                        <TextBlock Text="{Binding TotalValue}" Margin="7,0,0,0" TextWrapping="Wrap" VerticalAlignment="Center"/>
                                    </StackPanel>
                                </StackPanel>
                            </Grid>
                        </Grid>
                        <Grid Margin="20,20,20,0">
                            <Grid Width="100" HorizontalAlignment="Left">
                                <Image Height="64" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0"/>
                            </Grid>
                            <Grid Margin="110,0,0,0">
                                <StackPanel VerticalAlignment="Center">
                                    <Fluent:SeparatorTabItem Header="{StaticResource AdditionalOrderText}" Margin="6,0,0,0" FontSize="14" FontWeight="Bold" Foreground="DimGray" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,5,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                        <TextBlock Text="{StaticResource OrderTextStart}" Margin="7,0,0,0" TextWrapping="Wrap" VerticalAlignment="Center"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="20,0,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                        <TextBox Text="{Binding TextBefore}" AcceptsReturn="True" Height="54" Margin="7,0,0,0" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" Width="390" HorizontalScrollBarVisibility="Auto" BorderBrush="#FF9A9C9E"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="36,0,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                        <TextBlock Text="{StaticResource ChooseFromTemplate}" Margin="7,0,0,0" Width="130" TextWrapping="Wrap" VerticalAlignment="Center"/>
                                        <ComboBox Height="23" HorizontalAlignment="Left" Margin="7,0,0,0" VerticalAlignment="Top" Width="238" DisplayMemberPath="Name" SelectionChanged="ComboBoxStartingText_SelectionChanged" Name="combobox12"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,7,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                        <TextBlock Text="{StaticResource OrderTextEnd}" Margin="7,0,0,0" TextWrapping="Wrap" VerticalAlignment="Center"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="20,0,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                        <TextBox Text="{Binding OrderText}" AcceptsReturn="True" Height="54" Width="390" Margin="7,0,0,0" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" BorderBrush="#FF9A9C9E"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="36,0,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                        <TextBlock Text="{StaticResource ChooseFromTemplate}" Margin="7,0,0,0" Width="130" TextWrapping="Wrap" VerticalAlignment="Center"/>
                                        <ComboBox Height="23" HorizontalAlignment="Left" Margin="7,0,0,0" Name="ComboBox11" VerticalAlignment="Top" Width="238" DisplayMemberPath="Name"/>
                                    </StackPanel>
                                </StackPanel>
                            </Grid>
                        </Grid>
                        <Grid Margin="20,20,20,0">
                            <Grid Width="100" HorizontalAlignment="Left">
                                <Image Height="64" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0"/>
                            </Grid>
                            <Grid Margin="110,0,0,0">
                                <StackPanel VerticalAlignment="Center">
                                    <Fluent:SeparatorTabItem Header="{StaticResource PursueOrder}" Margin="6,0,0,0" FontSize="14" FontWeight="Bold" Foreground="DimGray" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,5,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                        <Fluent:Button Style="{DynamicResource ButtonBackstageStyle}" Margin="10,0,0,0" Name="FurtherOrder1" Height="85" Width="81" />
                                        <Fluent:Button Style="{DynamicResource ButtonBackstageStyle}" Margin="15,0,0,0" Name="FurtherOrder2" Height="85" Width="81" />
                                        <Fluent:Button Style="{DynamicResource ButtonBackstageStyle}" Margin="15,0,0,0" Name="FurtherOrder3" Height="85" Width="81" />
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,5,0,5" ClipToBounds="False" >
                                        <Rectangle Width="7" Height="7" Fill="DarkGray" StrokeThickness="0" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                        <ListView Margin="10,0,0,0" Name="ListView1" Width="410" SelectionMode="Single" ItemsSource="{Binding LinkedOrders}" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Height="100">
                                            <ListView.ItemContainerStyle>
                                                <Style TargetType="ListViewItem">
                                                    <Setter Property="HorizontalContentAlignment" Value="Center" />
                                                    <Setter Property="MinHeight" Value="20px" />
                                                </Style>
                                            </ListView.ItemContainerStyle>
                                            <ListView.View>
                                                <GridView>
                                                    <GridViewColumn Header="Datum" Width="{Binding ElementName=helperWidthAuftrag1, Path=ActualWidth}" DisplayMemberBinding="{Binding Date_}"/>
                                                    <GridViewColumn Header="Typ" Width="{Binding ElementName=helperWidthAuftrag2, Path=ActualWidth}" DisplayMemberBinding="{Binding OrderTyp, Converter={StaticResource OrderTypeConverter}}" />
                                                    <GridViewColumn Header="Nummer" Width="{Binding ElementName=helperWidthAuftrag3, Path=ActualWidth}" DisplayMemberBinding="{Binding OrderID}" />
                                                    <GridViewColumn Header="Name" Width="{Binding ElementName=helperWidthAuftrag4, Path=ActualWidth}" DisplayMemberBinding="{Binding CustomerName}" />
                                                    <GridViewColumn Header="Betrag" Width="{Binding ElementName=helperWidthAuftrag5, Path=ActualWidth}" DisplayMemberBinding="{Binding Value}" />
                                                </GridView>
                                            </ListView.View>
                                        </ListView>
                                    </StackPanel>
                                </StackPanel>
                            </Grid>
                        </Grid>
                    </StackPanel>
                    <!--GridView für die Größe-->
                    <Grid Visibility="Hidden" Width="{Binding ElementName=ListView1, Path=ActualWidth}">
                        <Grid.ColumnDefinitions>
                            <!--Width is bound to width of the first GridViewColumn -->
                            <ColumnDefinition Width="0.5*" MaxWidth="150"/>
                            <ColumnDefinition Width="0.6*" MaxWidth="150"/>
                            <ColumnDefinition Width="0.5*" MaxWidth="150"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="0.5*" MaxWidth="150"/>
                            <ColumnDefinition Width="0.15*" MinWidth="8"/>
                        </Grid.ColumnDefinitions>
                        <Grid Grid.Column="0" x:Name="helperWidthAuftrag1"/>
                        <Grid Grid.Column="1" x:Name="helperWidthAuftrag2"/>
                        <Grid Grid.Column="2" x:Name="helperWidthAuftrag3"/>
                        <Grid Grid.Column="3" x:Name="helperWidthAuftrag4"/>
                        <Grid Grid.Column="4" x:Name="helperWidthAuftrag5"/>
                    </Grid>
                </Grid>
            </ScrollViewer>
        </TabItem>
    </TabControl>
</TabItem>
